﻿using System;

namespace OnlineJudge
{
    public enum Language : byte
    {
        C = 1,
        C11 = 2,
        CPlus = 11,
        CPlus11 = 12,
        CSharp = 21,
        Java = 31,
        Python2 = 41,
        Python3 = 42,
        PyPy2 = 45,
        PyPy3 = 46,
        Ruby = 51,
        Php = 61,
        Haskell = 71,
        Scala = 81,
        Javascript = 91,
        Go = 101,
        VCPlus = 111,
        OC = 121,
        Pascal = 131
    }

    public enum JudgeState : byte
    {
        WaitForCompile = 1,
        Compiling = 2,
        Compiled = 3,
        CompileError = 4,
        WaitForRun = 5,
        Processing = 6,
        Complete = 7,
        SpecialJudgeProgramLost = 8,
        ZeroTest = 9,
        Crash = 100
    }
    public enum JudgeValue : byte
    {
        None = 0,
        Processing = 1,
        Accepted = 2,
        WrongAnswer = 3,
        MemoryLimitExceed = 4,
        TimeLimitExceed = 5,
        RunTimeError = 6,
        JudgeError = 7,
        CompileError = 8,

        ChallangeSucceed = 20,
        ChallangeFail = 21,
    }

    public enum JudgeResult : byte
    {
        Running = 0,
        Accepted = 1,
        WrongAnswer = 2,
        MemoryLimitExceed = 3,
        TimeLimitExceed = 4,
        RunTimeError = 5,
        DataFileLost = 6,
        CreateProcess = 8,
        Blocked = 9,

        ProblemError = 21,
        FormatError = 22,
        DataError = 23,
        DataOk = 24,
        ChallangeFail = 25,
        Succeed = 26,

        Retry = 100,
    }

    public enum JudgeType : byte
    {
        FileData,
        SpecialJudge
    }

    [Flags]
    public enum JudgeBreakOn : byte
    {
        None = 0,
        OnRunTimeError = 0x1,
        OnWrongAnswer = 0x2,
        OnTimeLimitExceed = 0x4,
        OnMemoryLimitExceed = 0x8,
        OnDataFileLost = 0x10,
        OnCreateProcess = 0x20,
        OnBlocked = 0x40,
        OnAny = 0xFF
    }

    public enum RunJobResult : byte
    {
        None = 0,
        ErrorOnCreateJob = 1,
        ErrorOnCreateProcess = 2,
        ErrorOnAddProcessToJob = 3,
        IocpTimeout = 4,
        AbnormalExitProcess = 5,
        ActiveProcessLimit = 6,
        EndOfProcessTime = 7,
        ProcessMemoryLimit = 8,
        RunningError = 9,
        RunningOk = 10,
    }

    public enum CompileType : byte
    {
        Program = 1,
        Tutorial = 2,
        Contest = 3,
        TryExecute = 4,
        Background = 5,
        Challange = 6,
        Open = 7,
        Exam = 8,
        SpecialJudge = 64,
        CompileSpecialJudge = 128,
        CompileSolution = 129,
    }
    /// <summary>
    /// 路由回调类型
    /// </summary>
    public enum RouterCallback : byte
    {
        /// <summary>
        /// 默认
        /// </summary>
        Judge,
        /// <summary>
        /// 考试
        /// </summary>
        Exam
    }
}